<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue2.js"></script>
</head>
<body>

<!--
        路由:   可以根据用户访问路径的不同 加载不同的组件到index.html页面进行渲染

          传统方案:  user.html  student.html
          SPA  单页面应用  web  index.html    div
                User.vue   Teacher.vue  Student.vue  单文件组件
        如何通过用户访问的路径  实现不同组件的渲染
        /teacher    =>  Teacher.vue
        /student    =>  Student.vue

        SPA = 组件  +  路由

-->
<div id="app">
    <student></student>
    <teacher></teacher>
</div>


<script>

    const student = {
        template: `
            <h1>学生信息展示</h1>
        `
    }

    const teacher = {
        template: `
            <h1>教师信息展示</h1>
        `
    }

    let vm = new Vue({
        el: '#app',
        data: {},
        methods: {},
        components: {
            student, teacher
        }
    })
</script>
</body>
</html>